home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1536 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help:  crash when doing fprintf
  5. Date: Mon, 15 Jan 96 11:42:03 GMT
  6. Organization: none
  7. Message-ID: <821706123snz@genesis.demon.co.uk>
  8. References: <DL74rA.L5v@info.physics.utoronto.ca>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <DL74rA.L5v@info.physics.utoronto.ca>
  15.            olivers@helios.physics.utoronto.ca "Oliver Schonborn" writes:
  16.  
  17. >It crashes deep inside the fprintf.  A trace with the debugger
  18. >indicates where (main called _fprintf which called _wrtchk which
  19. >called _findbuf which called malloc):
  20.  
  21. Crashing in malloc is a very strong indication your program corrupted the
  22. heap earlier in its execution. CHeck that your code doesn't write outside
  23. array bounds, use objects after they have been freed or free objects that
  24. weren't allocated by malloc/calloc/realloc.
  25.  
  26. It is quite normal for stdio functions to call malloc. They typically do
  27. it to allocate the I/O buffer when it is first needed.
  28.  
  29. -- 
  30. -----------------------------------------
  31. Lawrence Kirby | fred@genesis.demon.co.uk
  32. Wilts, England | 70734.126@compuserve.com
  33. -----------------------------------------
  34.